home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Folders.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  8KB  |  239 lines

  1. /*
  2.      File:        Folders.h
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Some
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __FOLDERS__
  19. #define __FOLDERS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __CODEFRAGMENTS__
  25. #include <CodeFragments.h>
  26. #endif
  27. #if FOR_SYSTEM8_PREEMPTIVE
  28. #ifndef __FILEMANAGERTYPES__
  29. #include <FileManagerTypes.h>
  30. #endif
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_ALIGN_SUPPORTED
  42. #pragma options align=mac68k
  43. #endif
  44.  
  45. #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  46.  
  47. enum {
  48.     kOnSystemDisk                = 0x8000,
  49.     kCreateFolder                = true,
  50.     kDontCreateFolder            = false,
  51.     kSystemFolderType            = 'macs',                        /* the system folder */
  52.     kDesktopFolderType            = 'desk',                        /* the desktop folder; objects in this folder show on the desk top. */
  53.     kTrashFolderType            = 'trsh',                        /* the trash folder; objects in this folder show up in the trash */
  54.     kWhereToEmptyTrashFolderType = 'empt',                        /* the "empty trash" folder; Finder starts empty from here down */
  55.     kPrintMonitorDocsFolderType    = 'prnt',                        /* Print Monitor documents */
  56.     kStartupFolderType            = 'strt',                        /* Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here */
  57.     kShutdownFolderType            = 'shdf',                        /* Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here */
  58.     kAppleMenuFolderType        = 'amnu',                        /* Finder objects to put into the Apple menu go here */
  59.     kControlPanelFolderType        = 'ctrl',                        /* Control Panels go here (may contain INITs) */
  60.     kExtensionFolderType        = 'extn',                        /* Finder extensions go here */
  61.     kFontsFolderType            = 'font',                        /* Fonts go here */
  62.     kPreferencesFolderType        = 'pref',                        /* preferences for applications go here */
  63.     kTemporaryFolderType        = 'temp'                        /* temporary files go here (deleted periodically, but don't rely on it.) */
  64. };
  65.  
  66. extern pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  67.  TWOWORDINLINE(0x7000, 0xA823);
  68.  
  69. extern pascal OSErr ReleaseFolder(short vRefNum, OSType folderType)
  70.  TWOWORDINLINE(0x700B, 0xA823);
  71.  
  72. #endif
  73. #if FOR_SYSTEM8_PREEMPTIVE
  74. /******************************************/
  75. /* Extensible Folder Manager declarations */
  76. /******************************************/
  77. /****************************/
  78. /* Folder Manager constants */
  79. /****************************/
  80. /* new gestalt constants for gestalt FindFolderAttr (to be moved to Gestalt.h) */
  81.  
  82. enum {
  83.     gestaltFolderDescSupport    = 1                                /* has FolderDesc calls */
  84. };
  85.  
  86. /* new Folder Manager error codes */
  87.  
  88. enum {
  89.     badFolderDescErr            = -4270,
  90.     duplicateFolderDescErr        = -4271,
  91.     noMoreFolderDescErr            = -4272,
  92.     invalidFolderTypeErr        = -4273,
  93.     duplicateRoutingErr            = -4274,
  94.     routingNotFoundErr            = -4275,
  95.     badRoutingSizeErr            = -4276
  96. };
  97.  
  98.  
  99. enum {
  100.     kExtensionDisabledFolderType = 'extD',
  101.     kControlPanelDisabledFolderType = 'ctrD',
  102.     kSystemExtensionDisabledFolderType = 'macD',
  103.     kApplicationsFolderType        = 'apps',
  104.     kDocumentsFolderType        = 'docs'
  105. };
  106.  
  107.  
  108. enum {
  109.                                                                 /* new constants */
  110.     kVolumeRootFolderType        = 'root',                        /* root folder of a volume */
  111.     kGlobalPreferencesFolderType = 'gprf',                        /* preferences for all users/workspaces */
  112.     kChewableItemsFolderType    = 'flnt',                        /* items deleted at boot */
  113.     kApplicationSupportFolderType = 'asup',                        /* third-party items and folders */
  114.     kSystem7SystemFolderType    = '[f]blu',                        /* System 7 system folder */
  115.     kDebuggerExtensionsFolderType = '[f]deb',                        /* debugger extensions */
  116.     kDesktopModulesFolderType    = '[f]dsk',                        /* desktop animation modules */
  117.     kEditorsFolderType            = '[f]edi',                        /* OpenDoc editors */
  118.     kExtensionLibrariesFolderType = '[f]exl',                        /* leechlets */
  119.     kCoopExtensionLibrariesFolderType = '[f]cex',                    /* blue leechlets */
  120.     kHardwareSupportFolderType    = '[f]hdw',                        /* hardware support */
  121.     kLocalesFolderType            = '[f]loc',                        /* locales */
  122.     kServerLibrariesFolderType    = '[f]ser',                        /* servers */
  123.     kSystemLibrariesFolderType    = '[f]sys',                        /* system libraries */
  124.     kTextEncodingsFolderType    = '[f]tex',                        /* encoding tables */
  125.     kThemesFolderType            = '[f]thm',                        /* themes */
  126.     kStationeryFolderType        = '[f]stn'                        /* stationery */
  127. };
  128.  
  129. /* FolderDescFlags values */
  130.  
  131. enum {
  132.     kPersistentFolderDesc        = 0x00000001,
  133.     kCreateFolderAtBoot            = 0x00000002,
  134.     kFolderCreatedInvisible        = 0x00000004,
  135.     kFolderCreatedNameLocked    = 0x00000008
  136. };
  137.  
  138. typedef UInt32 FolderDescFlags;
  139. /* FolderClass values */
  140.  
  141. enum {
  142.     kRelativeFolder                = 'relf',
  143.     kSpecialFolder                = 'spcf'
  144. };
  145.  
  146. typedef OSType FolderClass;
  147.  
  148. enum {
  149.     doReplace                    = true,
  150.     dontReplace                    = false
  151. };
  152.  
  153. /* known FolderType values */
  154.  
  155. enum {
  156.     kBlessedFolder                = 'blsf',
  157.     kCurrentWorkspaceFolder        = 'cwsf',
  158.     kRootFolder                    = 'rotf',
  159.     kWorkspacesFolder            = 'wksf'
  160. };
  161.  
  162. typedef OSType FolderType;
  163. typedef OSType FolderLocation;
  164. struct FolderDesc {
  165.     Size                             descSize;
  166.     FolderType                         foldType;
  167.     FolderDescFlags                 flags;
  168.     FolderClass                     foldClass;
  169.     FolderType                         foldLocation;
  170.     OSType                             badgeSignature;
  171.     OSType                             badgeType;
  172.     UInt32                             reserved;
  173.     Str63                             name;
  174. };
  175. typedef struct FolderDesc FolderDesc;
  176.  
  177. typedef UInt32 RoutingFlags;
  178. struct FolderRouting {
  179.     Size                             descSize;
  180.     OSType                             fileType;
  181.     FolderType                         routeFromFolder;
  182.     FolderType                         routeToFolder;
  183.     RoutingFlags                     flags;
  184. };
  185. typedef struct FolderRouting FolderRouting;
  186.  
  187. /* routing constants */
  188.  
  189. enum {
  190.     kPersistentRouting            = 0x00000001
  191. };
  192.  
  193. /***************************/
  194. /* Folder Manager routines */
  195. /***************************/
  196. /* Folder Manager administration routines */
  197. extern pascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, Str63 name, Boolean replaceFlag);
  198.  
  199. extern pascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc);
  200.  
  201. extern pascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes);
  202.  
  203. extern pascal OSErr RemoveFolderDescriptor(FolderType foldType);
  204.  
  205. extern pascal OSErr FindFolderFSObject(FolderType foldType, Boolean createFolder, FSObjectRef *objectRef);
  206.  
  207. extern pascal OSErr NewFindFolder(short vRefNum, FolderType foldType, Boolean createFolder, short *foundVRefNum, long *foundDirID);
  208.  
  209. extern pascal OSErr InvalidateFolderDescriptorCache(short vRefNum, long dirID);
  210.  
  211. /* legacy routines */
  212. extern pascal OSErr GetFolderName(short vRefNum, OSType foldType, short *foundVRefNum, StringPtr name);
  213.  
  214. /* routing routines */
  215. extern pascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag);
  216.  
  217. extern pascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder);
  218.  
  219. extern pascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags);
  220.  
  221. extern pascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings);
  222.  
  223. #endif
  224.  
  225. #if PRAGMA_ALIGN_SUPPORTED
  226. #pragma options align=reset
  227. #endif
  228.  
  229. #if PRAGMA_IMPORT_SUPPORTED
  230. #pragma import off
  231. #endif
  232.  
  233. #ifdef __cplusplus
  234. }
  235. #endif
  236.  
  237. #endif /* __FOLDERS__ */
  238.  
  239.